import Layer from "./Layer";

export default {
    mixins: [Layer],
    props: {
        zIndex: {
            type: Number,
            custom: true,
            default: 400,
        },
    },
    mounted() {
        this.layerGroupOptions = this.layerOptions;
    },
    methods: {
        addLayer(layer, alreadyAdded) {
            if (!alreadyAdded) {
                this.mapObject.addLayer(layer.mapObject);
            }
            this.parentContainer.addLayer(layer, true);
        },
        removeLayer(layer, alreadyRemoved) {
            if (!alreadyRemoved) {
                this.mapObject.removeLayer(layer.mapObject);
            }
            this.parentContainer.removeLayer(layer, true);
        },
    },
};
